import { defineStore } from 'pinia'
import type{ IAccount } from '@/types/types'

export const useAccountStore = defineStore ('account',{
  state(){
    return{
        account:{id:'',nick:'',url:''},
        // token:null
       
    }
  },
  actions:{
    saveAccount(account:IAccount){
        this.account = account
    },
    deleteAccount(){
      this.account = {id:'',nick:'',url:''}
  },
  },
  getters:{

  },
  persist: {
    enabled: true,
    strategies: [
        {
            key: 'account',
            storage: localStorage,
            paths: ['account'],
        },
    ],
},
})

